<?php 

session_start();

if(!isset($_SESSION['learning']) || $_SESSION['learning']!=true) {	
	define('ID', '');
	define('LEVEL','');
	define('NAMA', 'belum login');
} else {
	define('ID', $_SESSION['id_pengguna']);
	define('LEVEL', $_SESSION['jns_pengguna']);
	define('NAMA', $_SESSION['nm_pengguna']);
	
}
require_once 'konfigurasi.php';

fungsi('index');

define('PAGE', 'Index');
define('PAGE_ICO', 'icon-stats');
define('PAGE_URL', 'index.php');

panggil_header();

koneksi_buka();
echo 'nip :198611212010012004 ';
echo "nis : 4933 ";
?>

<div class="content">
                
		<div class="page-header">
			<div class="icon">
				<span class="ico-arrow-right"></span>
			</div>
			
			<h1> E-Learning<small>SDN I</small></h1>
		</div>
		<div class="row-fluid">
			<div class="span12">
				<div class="block">
					<?php if(isset($_GET['m']) && $_GET['m']=="salah") { ?>
						<div class="alert alert-error">            
								<strong>Ups!</strong> Nama pengguna / kata sandi salah... 
						</div>
					<?php } else if(isset($_GET['m']) && $_GET['m']=="jam") { ?>
					
                        <div class="alert alert-error">            
                            <strong>Ups!</strong> Belum waktunya login...
                        </div>
					
					<?php } else if(isset($_GET['m']) && $_GET['m']=="logout") { ?>
					
                        <div class="alert alert-success">            
                            <strong>Selamat!</strong> Anda berhasil keluar dari aplikasi...
                        </div>
					<?php } else{?>
						<h2> Selamat Datang di Halaman Beranda</h2>
					<?php }?>
				</div>
			</div>
		</div>
		
	</div>
    <div class="dialog" id="source" style="display: none;" title="Source"></div>
    
    <div class="dialog" id="dialog-login" style="display: none;" title="Login">
		<div class="login">

			<div class="page-header">
				<div class="icon">
					<span class="ico-arrow-right"></span>
				</div>
				<h1>Login <small>SDN I Surabaya</small></h1>
			</div>        
			
			<form method="post" action="login.php">
				<div class="row-fluid">
					<div class="row-form">
						<div class="span12">
							<input type="text" name="username" placeholder="username"/>
						</div>
					</div>
					<div class="row-form">
						<div class="span12">
							<input type="password" name="password" placeholder="password"/>
						</div>            
					</div>
					<div class="row-form">
						<div class="span12">
							<input type="submit" value="Masuk" name="submit" class="btn" />
						</div>                
					</div>
				</div>
			</form>
			</form>
		</div>
	</div>
	
	
	<div class="dialog" id="dialog-registrasi" style="display: none;" title="Registrasi">
		<div class="page-header">
			<div class="icon">
				<span class="ico-arrow-right"></span>
			</div>
			<h1>Registrasi <small>SDN I Surabaya</small></h1>
		</div>        
		
		<form id="validate" method="post" action="login.php">
			<div class="row-fluid">
				<div class="row-form">
					<div class="span3">NIS</div>
					<div class="span9">
						<select id="nis" name="nis" class="select" style="width: 100%;">
							<?php
								$q_siswa = mysql_query("select * from siswa");
								while($dt_siswa = mysql_fetch_array($q_siswa)) {
							?>
								<option value="<?php echo $dt_siswa['nis'] ?>"><?php echo $dt_siswa['nis']." (".$dt_siswa['nama'].")" ?></option>
							<?php } ?>                                                                 
						</select>
					</div>
				</div>
				<div class="row-form">
					<div class="span3">Nama</div>
					<div class="span9">
						<input type="text" id="username" name="username" placeholder="nama"/>
					</div>
				</div>
				<div class="row-form">
					<div class="span3">Password</div>
					<div class="span9">
						 <input type="password" name="password" class="validate[required,minSize[5],maxSize[10]]" id="password"/>
                         <span class="bottom">Required, min size = 5, max size = 10</span>
					</div>            
				</div>
				<div class="row-form">
					<div class="span3">Password Lagi</div>
					<div class="span9">
						<input type="password" class="validate[required,equals[password]]"/>
						<span class="bottom">Required, equals Password</span>
					</div>            
				</div>
				<div class="row-form">
					<div class="span3"></div>
					<div class="span9">
						<button class="btn btn-success">Registrasi</button>
						<button class="btn btn-warning">Batal</button>
					</div>                
				</div>
			</div>
		</form>
	</div>


<?php
panggil_footer();
?>
